{template "header.html"}

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="row myfbody">
        <div class="col-md-12">

            <div class="portlet light bordered">
                <div class="portlet-title">
                    <div class="caption">
                        <span class="caption-subject font-green sbold ">{dr_lang('创建小程序')}</span>
                    </div>

                    <div class="actions">
                        <div class="btn-group">
                            <a class="btn" href="{$reply_url}"> <i class="fa fa-mail-reply"></i> {dr_lang('返回列表')}</a>
                        </div>
                    </div>
                </div>
                <div class="portlet-body">
                    <div class="form-body">

                        <div class="form-group" id="dr_row_cid">
                            <label class="col-md-2 control-label ">关联商品</label>
                            <div class="col-md-9">

                                <label>
                                    <select class="form-control" name="data[cid]">
                                        {module module=cloud catid=$catid cache=10}
                                        <option {if $shop_id==$t.id} selected{/if} value="{$t.id}">{if $t.cloud_id}【云】{/if}{$t.title} - {$t.price}元</option>
                                        {/module}
                                    </select>
                                </label>

                                <span class="help-block">需要选择一个小程序商品；选择云端小程序时会从你的云端账号中扣除对应的金额</span>
                            </div>
                        </div>

                        <div class="form-group" id="dr_row_username">
                            <label class="col-md-2 control-label ">所属账号</label>
                            <div class="col-md-9">
                                {php echo dr_fieldform(array(
                                'ismain' => 1,
                                'ismember' => 1,
                                'fieldtype' => 'Textbtn',
                                'fieldname' => 'username',
                                'setting' => array(
                                'option' => array(
                                'width' => 200,
                                'name' => '资料',
                                'icon' => 'fa fa-user',
                                'func' => 'dr_show_member',
                                'extend_field' => 'uid',
                                'extend_function' => 'member:uid',
                                'value'	=> \Phpcmf\Service::C()->member['username']
                                ),
                                'validate' => array(
                                'check' => '_check_member',
                                'required' => 1,
                                )
                                )
                                ), $username);}
                            </div>
                        </div>

                        <div class="form-group" id="dr_row_name">
                            <label class="col-md-2 control-label ">小程序名称</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control input-xlarge" id="dr_name" name="data[name]" value="{$name}">
                            </div>
                        </div>


                    </div>
                </div>
            </div>

        </div>

    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">

            <label><button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存内容')}</button></label>
            <label><button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000', '{$reply_url}')" class="btn yellow"> <i class="fa fa-mail-reply-all"></i> {dr_lang('保存并返回')}</button></label>

        </div>
    </div>
</form>

{template "footer.html"}